﻿// Write an expression that checks if given positive integer number n (n ≤ 100) is prime. E.g. 37 is prime.

using System;

class CheckIfPrime
{
    static void Main()
    {
        Console.Write("Enter number: ");
        int number = int.Parse(Console.ReadLine());
        if (number < 0 || number >= 100)
        {
            Console.WriteLine("Your number is not correct. It has to be bigger than 0 and less or equal to 100.");
        }
        else if (number == 0 || number == 1)
        {
            Console.WriteLine("Your number {0} is not prime.", number);
        }
        else
        {
            bool flag = true;
            int numberDivided2 = number / 2;
            for (int i = 2; i < numberDivided2; i++)
            {
                if (number % i == 0)
                {
                    flag = false;
                    break;
                }
            }
            Console.WriteLine("The number is prime: {0}", flag);
        }
    }
}